package css.remoteClient;

import java.rmi.RemoteException;

import css.bussinessLogic.student.StudentService_Driver;
import css.bussinessLogic.student.StudentService_Stub;
import css.bussinessLogic.user.UserService_Driver;
import css.bussinessLogic.user.UserService_Stub;
import css.bussinessLogicService.UserService;
import css.bussinessLogicService.student.StudentService;
import css.databaseBL.DatabaseFactory_Stub;
import css.databaseBLService.DatabaseFactory;
import css.databaseBLService.DatabaseService;
import css.po.UserPO;
import css.po.student.StudentPO;

public class Client {
	public static void main(String[]  args) {
		DatabaseFactory databaseFactory = new DatabaseFactory_Stub();
		DatabaseService<UserPO> userDatabase = null;
		DatabaseService<StudentPO> studentDatabase = null;
		try {
			userDatabase = databaseFactory.getUserDatabase();
			studentDatabase = databaseFactory.getStudentDatabase();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		UserService userService = new UserService_Stub(userDatabase);
		UserService_Driver userDriver = new UserService_Driver();
		userDriver.drive(userService);
		
		StudentService studentService = new StudentService_Stub(studentDatabase);
		StudentService_Driver studentDriver = new StudentService_Driver();
		studentDriver.drive(studentService);
	}
}
